import { post, get, postcontent } from "./api.js";

export const getMenuListApi = (params) => new Promise((resolve, reject) => {
    post('/', params).then(res => {
        resolve(res.data)
    }).catch(err => {
        reject(err.data)
    })
})

export const getGameListApi = (params) => new Promise((resolve, reject) => {
    post('/game/index', params).then(res => {
        resolve(res.data)
    }).catch(err => {
        reject(err.data)
    })
})

export const getGameDetailApi = (params) => new Promise((resolve, reject) => {
    post('/game/content/lang/en', params).then(res => {
        resolve(res.data)
    }).catch(err => {
        reject(err.data)
    })
})

export const getGameBannerApi = (params) => new Promise((resolve, reject) => {
    post('/game/banner', params).then(res => {
        resolve(res.data)
    }).catch(err => {
        reject(err.data)
    })
})

export const getTopInfoApi = (params) => new Promise((resolve, reject) => {
    post('/article/topnews/lang/en', params).then(res => {
        resolve(res.data)
    }).catch(err => {
        reject(err.data)
    })
})

export const getNewsListApi = (params) => new Promise((resolve, reject) => {
    post('/article/index/lang/en', params).then(res => {
        resolve(res.data)
    }).catch(err => {
        reject(err.data)
    })
})

export const getNewsDetailApi = (params) => new Promise((resolve, reject) => {
    post('/article/content/lang/en', params).then(res => {
        resolve(res.data)
    }).catch(err => {
        reject(err.data)
    })
})

export const getParttnersApi = (params) => new Promise((resolve, reject) => {
    post('/home/parttners', params).then(res => {
        resolve(res.data)
    }).catch(err => {
        reject(err.data)
    })
})

export const getBackgroundApi = (params) => new Promise((resolve, reject) => {
    post('/game/background', params).then(res => {
        resolve(res.data)
    }).catch(err => {
        reject(err.data)
    })
})